Integrand size = 26, antiderivative size = 85 \[ \int \frac {(c-c \sec (e+f x))^3}{(a+a \sec (e+f x))^2} \, dx=\frac {c^3 x}{a^2}-\frac {c^3 \text {arctanh}(\sin (e+f x))}{a^2 f}-\frac {8 c^3 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}+\frac {4 c^3 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))} \]
c^3*x/a^2-c^3*arctanh(sin(f*x+e))/a^2/f-8/3*c^3*tan(f*x+e)/a^2/f/(1+sec(f* x+e))^2+4/3*c^3*tan(f*x+e)/a^2/f/(1+sec(f*x+e))
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 1.37 (sec) , antiderivative size = 189, normalized size of antiderivative = 2.22 \[ \int \frac {(c-c \sec (e+f x))^3}{(a+a \sec (e+f x))^2} \, dx=\frac {c^{5/2} \tan (e+f x) \left (4 \sqrt {2} \sqrt {a} \sqrt {c} \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},-\frac {3}{2},-\frac {1}{2},\frac {1}{2} (1+\sec (e+f x))\right ) \sqrt {1-\sec (e+f x)}-4 \sqrt {a} \sqrt {c} \left (-2+\sec (e+f x)+\sec ^2(e+f x)\right )-6 \text {arctanh}\left (\frac {\sqrt {-a c \tan ^2(e+f x)}}{\sqrt {a} \sqrt {c}}\right ) \cos ^2\left (\frac {1}{2} (e+f x)\right ) \sec (e+f x) \sqrt {-a c \tan ^2(e+f x)}\right )}{3 a^{5/2} f (-1+\sec (e+f x)) (1+\sec (e+f x))^2} \]
(c^(5/2)*Tan[e + f*x]*(4*Sqrt[2]*Sqrt[a]*Sqrt[c]*Hypergeometric2F1[-3/2, - 3/2, -1/2, (1 + Sec[e + f*x])/2]*Sqrt[1 - Sec[e + f*x]] - 4*Sqrt[a]*Sqrt[c ]*(-2 + Sec[e + f*x] + Sec[e + f*x]^2) - 6*ArcTanh[Sqrt[-(a*c*Tan[e + f*x] ^2)]/(Sqrt[a]*Sqrt[c])]*Cos[(e + f*x)/2]^2*Sec[e + f*x]*Sqrt[-(a*c*Tan[e + f*x]^2)]))/(3*a^(5/2)*f*(-1 + Sec[e + f*x])*(1 + Sec[e + f*x])^2)
Time = 0.48 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.91, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3042, 4391, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(c-c \sec (e+f x))^3}{(a \sec (e+f x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )^3}{\left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^2}dx\) |
\(\Big \downarrow \) 4391 |
\(\displaystyle \frac {\int \left (-\frac {\sec ^3(e+f x) c^3}{(\sec (e+f x)+1)^2}+\frac {3 \sec ^2(e+f x) c^3}{(\sec (e+f x)+1)^2}-\frac {3 \sec (e+f x) c^3}{(\sec (e+f x)+1)^2}+\frac {c^3}{(\sec (e+f x)+1)^2}\right )dx}{a^2}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {c^3 \text {arctanh}(\sin (e+f x))}{f}+\frac {4 c^3 \tan (e+f x)}{3 f (\sec (e+f x)+1)}-\frac {8 c^3 \tan (e+f x)}{3 f (\sec (e+f x)+1)^2}+c^3 x}{a^2}\) |
(c^3*x - (c^3*ArcTanh[Sin[e + f*x]])/f - (8*c^3*Tan[e + f*x])/(3*f*(1 + Se c[e + f*x])^2) + (4*c^3*Tan[e + f*x])/(3*f*(1 + Sec[e + f*x])))/a^2
3.1.23.3.1 Defintions of rubi rules used
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*( d_.) + (c_))^(n_), x_Symbol] :> Simp[c^n Int[ExpandTrig[(1 + (d/c)*csc[e + f*x])^n, (a + b*csc[e + f*x])^m, x], x], x] /; FreeQ[{a, b, c, d, e, f, n }, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0] && ILtQ[n, 0] && LtQ[m + n, 2]
Time = 0.66 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.68
method | result | size |
parallelrisch | \(\frac {c^{3} \left (4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}+3 f x +3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )-3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )\right )}{3 a^{2} f}\) | \(58\) |
derivativedivides | \(\frac {4 c^{3} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3}+\frac {\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}\right )}{f \,a^{2}}\) | \(66\) |
default | \(\frac {4 c^{3} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3}+\frac {\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}\right )}{f \,a^{2}}\) | \(66\) |
risch | \(\frac {c^{3} x}{a^{2}}-\frac {8 i c^{3} \left (3 \,{\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{3 f \,a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{3}}+\frac {c^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a^{2} f}-\frac {c^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{a^{2} f}\) | \(95\) |
norman | \(\frac {\frac {c^{3} x}{a}+\frac {c^{3} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a}+\frac {4 c^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 a f}-\frac {8 c^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{3 a f}+\frac {4 c^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{3 a f}-\frac {2 c^{3} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{2} a}+\frac {c^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a^{2} f}-\frac {c^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a^{2} f}\) | \(180\) |
1/3*c^3*(4*tan(1/2*f*x+1/2*e)^3+3*f*x+3*ln(tan(1/2*f*x+1/2*e)-1)-3*ln(tan( 1/2*f*x+1/2*e)+1))/a^2/f
Leaf count of result is larger than twice the leaf count of optimal. 173 vs. \(2 (81) = 162\).
Time = 0.28 (sec) , antiderivative size = 173, normalized size of antiderivative = 2.04 \[ \int \frac {(c-c \sec (e+f x))^3}{(a+a \sec (e+f x))^2} \, dx=\frac {6 \, c^{3} f x \cos \left (f x + e\right )^{2} + 12 \, c^{3} f x \cos \left (f x + e\right ) + 6 \, c^{3} f x - 3 \, {\left (c^{3} \cos \left (f x + e\right )^{2} + 2 \, c^{3} \cos \left (f x + e\right ) + c^{3}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, {\left (c^{3} \cos \left (f x + e\right )^{2} + 2 \, c^{3} \cos \left (f x + e\right ) + c^{3}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 8 \, {\left (c^{3} \cos \left (f x + e\right ) - c^{3}\right )} \sin \left (f x + e\right )}{6 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}} \]
1/6*(6*c^3*f*x*cos(f*x + e)^2 + 12*c^3*f*x*cos(f*x + e) + 6*c^3*f*x - 3*(c ^3*cos(f*x + e)^2 + 2*c^3*cos(f*x + e) + c^3)*log(sin(f*x + e) + 1) + 3*(c ^3*cos(f*x + e)^2 + 2*c^3*cos(f*x + e) + c^3)*log(-sin(f*x + e) + 1) - 8*( c^3*cos(f*x + e) - c^3)*sin(f*x + e))/(a^2*f*cos(f*x + e)^2 + 2*a^2*f*cos( f*x + e) + a^2*f)
\[ \int \frac {(c-c \sec (e+f x))^3}{(a+a \sec (e+f x))^2} \, dx=- \frac {c^{3} \left (\int \frac {3 \sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \left (- \frac {3 \sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\right )\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \left (- \frac {1}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\right )\, dx\right )}{a^{2}} \]
-c**3*(Integral(3*sec(e + f*x)/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral(-3*sec(e + f*x)**2/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral(sec(e + f*x)**3/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Int egral(-1/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x))/a**2
Leaf count of result is larger than twice the leaf count of optimal. 268 vs. \(2 (81) = 162\).
Time = 0.29 (sec) , antiderivative size = 268, normalized size of antiderivative = 3.15 \[ \int \frac {(c-c \sec (e+f x))^3}{(a+a \sec (e+f x))^2} \, dx=\frac {c^{3} {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{2}} - \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a^{2}} + \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a^{2}}\right )} - c^{3} {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} + \frac {3 \, c^{3} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}} - \frac {3 \, c^{3} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, f} \]
1/6*(c^3*((9*sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^3/(cos(f*x + e ) + 1)^3)/a^2 - 6*log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/a^2 + 6*log(sin (f*x + e)/(cos(f*x + e) + 1) - 1)/a^2) - c^3*((9*sin(f*x + e)/(cos(f*x + e ) + 1) - sin(f*x + e)^3/(cos(f*x + e) + 1)^3)/a^2 - 12*arctan(sin(f*x + e) /(cos(f*x + e) + 1))/a^2) + 3*c^3*(3*sin(f*x + e)/(cos(f*x + e) + 1) + sin (f*x + e)^3/(cos(f*x + e) + 1)^3)/a^2 - 3*c^3*(3*sin(f*x + e)/(cos(f*x + e ) + 1) - sin(f*x + e)^3/(cos(f*x + e) + 1)^3)/a^2)/f
Time = 0.33 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.94 \[ \int \frac {(c-c \sec (e+f x))^3}{(a+a \sec (e+f x))^2} \, dx=\frac {\frac {4 \, c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3}}{a^{2}} + \frac {3 \, {\left (f x + e\right )} c^{3}}{a^{2}} - \frac {3 \, c^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a^{2}} + \frac {3 \, c^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a^{2}}}{3 \, f} \]
1/3*(4*c^3*tan(1/2*f*x + 1/2*e)^3/a^2 + 3*(f*x + e)*c^3/a^2 - 3*c^3*log(ab s(tan(1/2*f*x + 1/2*e) + 1))/a^2 + 3*c^3*log(abs(tan(1/2*f*x + 1/2*e) - 1) )/a^2)/f
Time = 13.22 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.54 \[ \int \frac {(c-c \sec (e+f x))^3}{(a+a \sec (e+f x))^2} \, dx=\frac {c^3\,x}{a^2}-\frac {c^3\,\left (2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )-\frac {4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{3}\right )}{a^2\,f} \]